<script setup>
import router from "./routers/router.js";
import {ref} from "vue";
let myPath=ref('')
function showAll(){
  router.push('/list')
}
function goMyPath(){
  router.push(myPath.value)
}
</script>

<template>
  <div>
    <router-link to="/">Home页面</router-link>
    <router-link to="/list">List页面</router-link>
    <router-link to="/showAll">showAll页面</router-link>
    <router-link to="/add">Add页面</router-link>
    <router-link to="/update">Update页面</router-link>
    <router-view name="listView"></router-view>
    <router-view name="HomeView"></router-view>
    <router-view name="updateView"></router-view>
    <router-view name="addView"></router-view>
    <!--    <router-view></router-view>-->
    <button @click="showAll">点击后通过函数跳转showAll页面，但是由于重定向到list,所以返回list页面</button>
    <br>
    <input type="text" placeholder="输入要去的页面" v-model="myPath">
    <button @click="goMyPath">GO</button>
  </div>
</template>

<style scoped>

</style>
